﻿<UserControl x:Class="RBEReport.UserControl1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d"
             xmlns:local="clr-namespace:RBEReport"
             Name="m_thisWindow" 
             d:DesignHeight="504" d:DesignWidth="1013">
  <UserControl.Resources>
    <DataTemplate x:Key="planDetailsTemplate">
      <Border Name="border" BorderBrush="White" BorderThickness="1"
          Padding="5" Margin="5,5,5,10">
        <Grid>
          <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
          </Grid.RowDefinitions>
          <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
          </Grid.ColumnDefinitions>
          <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding Path=PlanID}" FontWeight="Bold"/>

          <TextBlock Grid.Row="1" Grid.Column="0" Text="Course ID:"/>
          <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=CourseID}"/>

          <TextBlock Grid.Row="2" Grid.Column="0" Text="Plan Type:"/>
          <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Path=PlanType}"/>
          <TextBlock Grid.Row="2" Grid.Column="2" Text="Technique:"/>
          <TextBlock Grid.Row="2" Grid.Column="3" Text="{Binding Path=Technique}"/>

          <TextBlock Grid.Row="3" Grid.Column="0" Text="Dose / Fraction:"/>
          <TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding Path=DosePerFraction}"/>
          <TextBlock Grid.Row="3" Grid.Column="2" Text="Prescribed Percentage:"/>
          <TextBlock Grid.Row="3" Grid.Column="3" Text="{Binding Path=PrescPercentage}"/>

          <TextBlock Grid.Row="4" Grid.Column="0" Text="Number of Fractions:"/>
          <TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding Path=NumberOfFractions}"/>

          <TextBlock Grid.Row="5" Grid.Column="0" Text="Target Volume ID:"/>
          <TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding Path=TargetVolumeID}"/>
          <TextBlock Grid.Row="5" Grid.Column="2" Text="Target Volume a/b:"/>
          <TextBlock Grid.Row="5" Grid.Column="3" Text="{Binding Path=TargetAB}"/>

          <TextBlock Grid.Row="6" Grid.Column="0" Text="Total Dose Planned:"/>
          <TextBlock Grid.Row="6" Grid.Column="1" Text="{Binding Path=TotalDosePlanned}"/>
          <TextBlock Grid.Row="6" Grid.Column="2" Text="EQD2 Dose Planned:"/>
          <TextBlock Grid.Row="6" Grid.Column="3" Text="{Binding Path=EQD2DosePlanned}"/>

          <TextBlock Grid.Row="7" Grid.Column="0" Text="Approval Status:"/>
          <TextBlock Grid.Row="7" Grid.Column="1" Text="{Binding Path=Status}"/>

          <TextBlock Grid.Row="8" Grid.Column="0" Text="Modification by:"/>
          <TextBlock Grid.Row="8" Grid.Column="1" Text="{Binding Path=Modified}"/>
          <TextBlock Grid.Row="8" Grid.Column="2" Text="Modification Date/Time:"/>
          <TextBlock Grid.Row="8" Grid.Column="3" Text="{Binding Path=Date}"/>

        </Grid>
      </Border>
    </DataTemplate>
  </UserControl.Resources>
  <Grid DataContext="{Binding ElementName=m_thisWindow,Path=VM}" MinWidth="726" MinHeight="352" Height="auto" Width="auto">
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,12,0,0" Name="textBlock1" Text="Patient ID:" VerticalAlignment="Top" />
    <TextBox Height="23" Margin="167,9,0,0" Name="patientID" Text="{Binding PatientId}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="130" IsReadOnly="True" FontWeight="SemiBold" BorderThickness="0" />
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,41,0,0" Name="textBlock2" Text="Patient Name:" VerticalAlignment="Top" />
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,70,0,0" Name="textBlock3" Text="Date of Birth:" VerticalAlignment="Top" />
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,99,0,0" Name="textBlock4" Text="Course ID:" VerticalAlignment="Top" />
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,128,0,0" Name="textBlock5" Text="Plan ID:" VerticalAlignment="Top" />
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,157,0,0" Name="textBlock6" Text="Approval Status:" VerticalAlignment="Top" />
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,186,0,0" Name="textBlock7" Text="Modification by:" VerticalAlignment="Top" />
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,215,0,0" Name="textBlock8" Text="Modification Date/Time:" VerticalAlignment="Top" />
    <TextBox Height="23" Margin="167,41,0,0" Name="patientName" Text="{Binding PatientName}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="228" IsReadOnly="True" FontWeight="SemiBold" BorderThickness="0" />
    <TextBox Height="23" Margin="167,70,0,0" Name="dateOfBirth" Text="{Binding DOB}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="130" IsReadOnly="True" BorderThickness="0" />
    <TextBox Height="23" Margin="167,99,0,0" Name="courseID" Text="{Binding CourseId}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="130" IsReadOnly="True" BorderThickness="0" />
    <TextBox Height="23" Margin="167,128,0,0" Name="planID" Text="{Binding PlanId}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="130" IsReadOnly="True" BorderThickness="0" />
    <TextBox Height="23" Margin="167,157,0,0" Name="approvalStatus" Text="{Binding Approval}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="130" IsReadOnly="True" BorderThickness="0" />
    <TextBox Height="23" Margin="167,186,0,0" Name="modificationBy" Text="{Binding Modification}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="130" IsReadOnly="True" BorderThickness="0" />
    <TextBox Height="23" Margin="167,212,0,0" Name="ModificationDate" Text="{Binding Date}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="130" IsReadOnly="True" BorderThickness="0" />
    <TextBlock Height="23" HorizontalAlignment="Left" Margin="12,244,0,0" Name="textBlock9" Text="Plan Summary" VerticalAlignment="Top" FontWeight="Bold" />
    <DataGrid AutoGenerateColumns="False" Height="89" Margin="12,273,24,0" Name="dataGrid1" ItemsSource="{Binding}" VerticalAlignment="Top" CanUserAddRows="False" CanUserDeleteRows="False">
      <DataGrid.Columns>
        <DataGridTextColumn Header="Course ID" Binding="{Binding CourseID}" IsReadOnly="True" Width="*"/>
        <DataGridTextColumn Header="Plan ID" Binding="{Binding PlanID}" Width="*" IsReadOnly="True" />
        <DataGridTextColumn Header="Plan Type" Binding="{Binding PlanType}" Width="*" IsReadOnly="True" />
        <DataGridTextColumn Header="Target Volume ID" Binding="{Binding TargetVolumeID}" Width="*" IsReadOnly="True" />
        <DataGridTextColumn Header="Target a/b" Binding="{Binding TargetAB}" Width="*"/>
        <DataGridTextColumn Header="Presc. %" Binding="{Binding PrescPercentage}" Width="*" IsReadOnly="True" />
        <DataGridTextColumn Header="Dose / Fraction" Binding="{Binding DosePerFraction}" Width="*" IsReadOnly="True" />
        <DataGridTextColumn Header="Number of Fractions" Binding="{Binding NumberOfFractions}" Width="*" IsReadOnly="True" />
        <DataGridTextColumn Header="Total Dose Planned" Binding="{Binding TotalDosePlanned}" Width="*" IsReadOnly="True" />
        <DataGridTextColumn Header="EQD2 Dose Planned" Binding="{Binding EQD2DosePlanned}" Width="*" IsReadOnly="True" />
      </DataGrid.Columns>
    </DataGrid>
    <TextBlock FontWeight="Bold" HorizontalAlignment="Left" Margin="12,402,0,0" Name="textBlock10" Text="Plan Details" Height="23" VerticalAlignment="Top" />
    <ListBox Height="Auto" Margin="12,428,24,0" Name="listBox1" VerticalAlignment="Top" ItemsSource="{Binding}" ItemTemplate="{StaticResource planDetailsTemplate}" HorizontalContentAlignment="Stretch" BorderBrush="White" MinHeight="10" />
    <TextBlock Height="28" HorizontalAlignment="Left" Margin="12,368,0,0" Name="textBlock11" Text="Total Planned EQD2 Dose:" VerticalAlignment="Top" Width="186" />
    <TextBox BorderThickness="0" Height="23" HorizontalAlignment="Left" IsReadOnly="True" Margin="215,367,0,0" Name="textBox1" Text="{Binding TotalEQD2Dose}" VerticalAlignment="Top" Width="130" />
    <Button Content="Export PDF to C:\temp" Height="39" Margin="0,30,24,0" Name="button1" VerticalAlignment="Top" Click="button1_Click" HorizontalAlignment="Right" Width="151" />
    <Button Content="Post as PDF to Aria" Height="39" HorizontalAlignment="Right" Margin="0,83,24,0" Name="button2" VerticalAlignment="Top" Width="151" Click="button2_Click"/>
  </Grid>
</UserControl>
